//
//  ViewController5.m
//  30303
//
//  Created by student on 16/3/18.
//  Copyright © 2016年 NIIT. All rights reserved.
//

#import "ViewController5.h"

@interface ViewController5 ()

@property (weak, nonatomic) IBOutlet UIImageView *imageview;
@end

@implementation ViewController5

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    UIBezierPath *bezierpath=[UIBezierPath bezierPath];
    [bezierpath moveToPoint:CGPointMake(10.0, 10.0)];
    [bezierpath addQuadCurveToPoint:CGPointMake(100, 300) controlPoint:CGPointMake(300, 100)];
    
    CAKeyframeAnimation *posanim=[CAKeyframeAnimation animationWithKeyPath:@"position"];
    posanim.path=bezierpath.CGPath;
    posanim.removedOnCompletion=YES;
    
    CABasicAnimation *scaleanim=[CABasicAnimation animationWithKeyPath:@"trainform.scale"];
    scaleanim.fromValue=@0.5;
    scaleanim.toValue=@2;
    
    
    CABasicAnimation *opactityanim=[CABasicAnimation animationWithKeyPath:@"opacity"];
    opactityanim.fromValue=@0.5;
    opactityanim.toValue=@1;
    
    CAAnimationGroup *group=[CAAnimationGroup animation];
    group.animations=@[scaleanim,opactityanim,posanim];
    group.duration=1;
    [self.imageview.layer addAnimation:group forKey:nil];
    
    
    
    
    
    
    
    
    
    
    
}
@end
